%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This code generates the Figures 3 for "Self-Fulfilling Prophecies, 
% Quasi-Non-Ergodicity & Wealth Inequality by
% Jean-Philippe Bouchaud and Roger E. A. Farmer This version by R.E.A.
% Farmer:  August 2 2022
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

delt = 3.9*10^(-4);

alph = linspace(0.2,2,10);
lam = sqrt(delt./alph);

sd = sqrt((lam./(2 + (alph-1).*lam)).*alph.*(alph+2)./(6*(2*alph+1)));

figure(3)

plot(alph,sd,'LineWidth',3)
ylim([0,0.07]);
xlabel('Value of alpha', 'FontSize',20)
ylabel('Standard Deviation of Disagreement','FontSize',20)